﻿#region using
using System;

#endregion

namespace TimeZoneTest.Model
{
   public class AsyncReponse<T> : EventArgs
   {
      public AsyncReponse()
      {
      }

      public AsyncReponse(T result)
      {
         Result = result;
      }

      public AsyncReponse(T result, bool isFailed, Exception error)
      {
         Result = result;
         IsFailed = isFailed;
         Error = error;
      }

      public T Result { get; set; }

      public bool IsFailed { get; private set; }

      public Exception Error { get; private set; }

      public void SetError(Exception error)
      {
         Error = error;
         IsFailed = true;
      }
   }
}